FROM golang:alpine as builder
LABEL author="vincentzou<vincentzou@citictel.com>" \
      version="0.0.1"\
      description="extract data from mysql for metrics"

ENV GO111MODULE=on \
    CGO_ENABLE=0 \
    GOOS=linux \
    GOARCH=amd64 \
    GOPROXY=https://goproxy.cn

WORKDIR /build
COPY . .
RUN go build -o app .

FROM alpine:latest
COPY --from=builder /build/app /app/
COPY conf /conf
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
WORKDIR /app

ENTRYPOINT ["/docker-entrypoint.sh"]
